<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <button>按钮</button>
  <script>
    var btn = document.querySelector('button')

    // btn.onclick = function() {
    //   console.log(123123)
    // }
    // btn.onclick = function() {
    //   console.log(456456)
    // }

    // 1. 可以注册多个
    // 2. 捕获
    btn.addEventListener('click', function() {
      console.log('11111')
    })
    btn.addEventListener('click', function() {
      console.log('2222')
    })
  </script>
</body>
</html>